All Questions
2 questions
0votes
1answer
267views
Which is better in terms of performance (bool01==bool02) vs (bool01 && bool02) [duplicate]
Which of these two is the better way of doing the same thing - public void someMethod(String s, boolean bool02){ boolean bool01 = s!=null; if(bool01==bool02){ doSomething(); } } OR public void ...
276votes
14answers
125kviews
Should we avoid object creation in Java?
I was told by a colleague that in Java object creation is the most expensive operation you could perform. So I can only conclude to create as few objects as possible. This seems somewhat to defeat ...